<%--
  Created by IntelliJ IDEA.
  User: de
  Date: 2022/4/14
  Time: 15:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Title</title>
    <link rel="stylesheet" href="${path}/plugins/bootstrap-3.4.1-dist/css/bootstrap.css">
<%--    <link rel="stylesheet" href="${path}/index.html">--%>
    <link href="${path}/plugins/Hplus/css/font-awesome.css" rel="stylesheet">

    <link href="${path}/plugins/Hplus/css/animate.css" rel="stylesheet">
    <link href="${path}/plugins/Hplus/css/style.css" rel="stylesheet">
    <link rel="stylesheet" href="${path}/css/classify/index.css">
    <link rel="stylesheet" href="${path}/css/classify/classify.css">
    <link rel="stylesheet" href="${path}/css/index/index.css">
</head>
<body>
<%@include file="../nav/navbarheader.jsp"%>
<div class="background">
<%--    地点分类--%>
    <div class="place">
        <div class="place_auto">
            <div class="auto_left">
                <h4>地点</h4>
            </div>
            <div class="auto_right">
                <ul id="myTab" class="nav nav-tabs">
                    <li class="active">
                        <a href="#hot" data-toggle="tab">
                            热门商场
                        </a>
                    </li>
                    <li><a href="#biz" data-toggle="tab">行政区</a></li>
                    <li><a href="#sub" data-toggle="tab">地铁线</a></li>
                </ul>
                <div id="myTabContent" class="tab-content">
                    <div class="tab-pane fade in active" id="hot">
                        <ul>
                            <li> <a href="#" class="pl" value="苏州中心商场">苏州中心商场</a>
                            <input type="hidden" name="area" value="苏州中心商场"></li>
                            <li><a href="#" class="pl" value="木渎地区">木渎地区</a>
                            <input type="hidden" name="area" value="木渎地区"></li>
                            <li> <a href="#"  class="pl" value="独墅户大学城">独墅户大学城</a>
                            <input type="hidden" name="area" value="独墅户大学城"></li>
                            <li> <a href="#" class="pl" value="长桥地区">长桥地区</a>
                            <input type="hidden" name="area" value="长桥地区"></li>
                            <li><a href="#" class="pl" value="博览中心">博览中心</a>
                            <input type="hidden" name="area" value="博览中心"></li>
                            <li><a href="#" class="pl" value="圆融时代广场">圆融时代广场</a>
                            <input type="hidden" name="area" value="圆融时代广场"></li>
                            <li><a href="#" class="pl" value="观前街地">观前街地区</a>
                            <input type="hidden" name="area" value="观前街地区"></li>
                            <li><a href="#" class="pl" value="石路地区">石路地区</a>
                            <input type="hidden" name="area" value="石路地区"></li>
                            <li><a href="#" class="pl" value="十全街">十全街</a>
                            <input type="hidden" name="area" value="十全街"></li>
                            <li><a href="#" class="pl" value="绿宝广场">绿宝广场</a>
                            <input type="hidden" name="area" value="绿宝广场"></li>
                        </ul>
                        <ul><li><a href="#" class="pl" value="平江路">平江路</a>
                            <input type="hidden" name="area" value="平江路"></li>
                            <li><a href="#" class="pl" value="李公堤">李公堤</a>
                            <input type="hidden" name="area" value="李公堤"></li>
                            <li><a href="#" class="pl" value="湖东邻里中心">湖东邻里中心</a>
                            <input type="hidden" name="area" value="湖东邻里中心"></li>
                            <li><a href="#" class="pl" value="枫桥地区">枫桥地区</a>
                            <input type="hidden" name="area" value="枫桥地区"></li>
                            <li><a href="#" class="pl" value="繁花中心">繁花中心</a>
                            <input type="hidden" name="area" value="繁花中心"></li>
                        </ul>

                    </div>
                    <div class="tab-pane fade" id="biz">
                        <ul><li><a href="#" class="pl" value="姑苏区">姑苏区</a>
                            <input type="hidden" name="area" value="姑苏区"></li>
                            <li><a href="#" class="pl" value="虎丘区">虎丘区</a>
                            <input type="hidden" name="area" value="虎丘区"></li>
                            <li><a href="#" class="pl" value="苏州工业园区">苏州工业园区</a>
                            <input type="hidden" name="area" value="苏州工业园区"></li>
                            <li><a href="#" class="pl" value="吴中区">吴中区</a>
                            <input type="hidden" name="area" value="吴中区"></li>
                            <li><a href="#" class="pl" value="相城区">相城区</a>
                            <input type="hidden" name="area" value="相城区"></li>
                            <li><a href="#" class="pl" value="昆山">昆山</a>
                            <input type="hidden" name="area" value="昆山"></li>
                            <li><a href="#" class="pl" value="吴江">吴江</a>
                            <input type="hidden" name="area" value="吴江"></li>
                            <li><a href="#" class="pl" value="常熟">常熟</a>
                            <input type="hidden" name="area" value="常熟"></li>
                            <li><a href="#" class="pl" value="张家港">张家港</a>
                            <input type="hidden" name="area" value="张家港"></li>
                            <li><a href="#" class="pl" value="太仓">太仓</a>
                            <input type="hidden" name="area" value="太仓"></li></ul>


                    </div>
                    <div class="tab-pane fade" id="sub">
                        <ul><li><a href="#" class="pl" value="1号线">1号线</a>
                            <input type="hidden" name="area" value="1号线"></li>
                            <li><a href="#" class="pl" value="4号线支线">4号线支线</a>
                            <input type="hidden" name="area" value="4号线支线"></li>
                            <li><a href="#" class="pl" value="3号线">3号线</a>
                            <input type="hidden" name="area" value="3号线"></li>
                            <li><a href="#" class="pl" value="5号线">5号线</a>
                            <input type="hidden" name="area" value="5号线"></li>
                            <li><a href="#" class="pl" value="2号线">2号线</a>
                            <input type="hidden" name="area" value="2号线"></li>
                            <li><a href="#" class="pl" value="4号线">4号线</a>
                            <input type="hidden" name="area" value="4号线"></li></ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
<%--    place-end--%>
<%--    地点分类结束--%>
        <div class="classify_background">
            <div class="classify">
<%--                类型分类--%>
                <div class="classify_left">
                    <h4>限时秒杀团购</h4>
                        <c:choose>
                            <c:when test="${seckillList.size() == 0}">
                                <div align="center" style="font-size: 35px">
                                    <h4>抱歉，暂时还没有秒杀团购券！</h4>
                                </div>
                            </c:when>
                            <c:when test="${seckillList.size() > 0}">
                                <c:forEach var="seckill" items="${seckillList}">
                                    <div class="seckillitem">
                                        <p class="title">${seckill.goodsName}</p>
                                        <img class="pic1" src="/fr/${seckill.goodsPicture}" alt="" style="left: 0px;top: 0px;">
                                        <span class="price">
                                                <em>限时特价￥</em>${seckill.price}
                                            </span>
                                        <del class="del-price">￥${seckill.goodsCurrentPrice}</del>
                                        <i class="tag tag-tuan"> </i>
                                        <br>
                                        <span class="sold-count">剩余个数${seckill.num}</span>
                                        <div class="validity" id="time_${seckill.seckillId}">
                                            <input type="hidden" name="timeSeckill" value="time_${seckill.seckillId}">
                                            <input type="hidden" name="time_${seckill.seckillId}" value="${seckill.endTime}">
                                        </div>
                                        <button class="btn btn-success seckill" onclick="doSeckill(${user.id},${seckill.seckillId})">抢购</button>
                                    </div>
                                </c:forEach>
                            </c:when>
                        </c:choose>
                    </div>
                </div>
<%--    类型分类结束--%>
<%--    菜系分类--%>

                <div class="classify_right">
                    <div class="right_first">
                        <div class="menu">
                            <div class="top">
                                <h3>按菜系浏览</h3>
                                </div>
                            </div>
<%--                            模态框结束--%>
<%--                            按菜系分类--%>
                            <div class="row1">
                                <div class="col-sm-4">
                                    <img src="${path}/imgs/classify/coffee.jpg" alt="">
                                    <div class="text">
                                        <a href="#" class="type1"  value="1">中餐</a>
                                        <input type="hidden" name="type" value="1">
                                    </div>
                                </div>
                                <div class="col-sm-4">
                                    <img src="${path}/imgs/classify/中餐.jpg" alt="">
                                    <div class="text">
                                        <a href="#" class="type1"  value="2">甜品</a>
                                        <input type="hidden" name="type1" value="2">
                                    </div>
                                </div>
                                <div class="col-sm-4">
                                    <img src="${path}/imgs/classify/日式料理.jpg" alt="">
                                    <div class="text">
                                        <a href="#" class="type1"  value="3">西餐</a>
                                        <input type="hidden" name="type" value="3">
                                    </div>
                                </div>

                            </div>
                            <div class="row2">
                                <div class="top1">
                                    <h3>按人均消费浏览</h3>
                                </div>
                                <div class="col-sm-4">
                                    <img src="${path}/imgs/classify/意餐.jpg" alt="">
                                    <div class="text">
                                        <a href="#" class="consumption">平价美食</a>
                                        <input type="hidden" name="type1" value="0">
                                        <input type="hidden" name="type2" value="100">
                                    </div>
                                </div>
                                <div class="col-sm-4">
                                    <img src="${path}/imgs/classify/寿司.jpg" alt="">
                                    <div class="text">
                                        <a href="#" class="consumption">中等价位</a>
                                        <input type="hidden" name="type2" value="100">
                                        <input type="hidden" name="type1" value="300">
                                    </div>
                                </div>
                                <div class="col-sm-4">
                                    <img src="${path}/imgs/classify/牛排馆.jpg" alt="">
                                    <div class="text">
                                        <a href="#" class="consumption">高档餐厅</a>
                                        <input type="hidden" name="type1" value="300">
                                        <input type="hidden" name="type1" value="500">
                                    </div>
                                </div>

                            </div>
<%--                            菜系分类结束--%>
<%--                            平价美食--%>


<%--                            中等价位结束--%>
<%--                            苏州市热门餐厅--%>
                                <div class="popular_restaurant">
                                    <div class="pop" id="lik">
                                    <div class="restaurant_top">
                                        <ul><li><h3>苏州市热门餐厅</h3></li></ul>
                                        <div class="sort">
                                        </div>
                                    </div>
                                    <div class="popular" id="likee">


                                    </div>
                                </div>
                        </div>
<%--                            热门餐厅结束--%>
                        </div>
                    </div>
                </div>
            </div>
<%--                right-end--%>
            </div>
<%--            classify-end--%>
        </div>

<%--    classify-background-end--%>
</div>
<script src="${path}/plugins/jquery.min.js"></script>
<!-- 引入bootstrap.js/bootstrap.min.js,bootstrap依赖于jquery框架 -->
<script src="${path}/plugins/bootstrap-3.4.1-dist/js/bootstrap.js"></script>
<script src="${path}/js/index/login.js"></script>
<script src="${path}/js/index/register.js"></script>
<script src="${path}/js/index/index.js"></script>

<script>
    let userIdHid = $("input[name='userIdHid']").val();
        $(function () {
            $.ajax({
                type:"post",
                url:'${path}/fr/score/1',
                success:function(res) {
                    console.log(res.data)
                    console.log(res.data.list);
                    let list = eval(res.data.list)
                    let str =""
                    let page = "";
                    let Page = "";
                        $.each(list,function (idx,item) {
                            str+="<div class=\"pp\" id=\"likeee\">\n" +
                                "  <div class=\" first_restaurant\" style=\"height: 220px;background-color: white;margin-left: 70px\" id=\"idx\" >" +
                                "                            <div class=\"first_restaurant_left\">\n" +
                                "<a href='/fr/storeInfo/enter/"+item.id+"' onclick='writerHistory("+userIdHid+","+item.id+")'>" +
                                "                                <img  src=\"/fr"+item.shop_picture+"\" style=\" width: 272px; height: 212px;\"alt=\"\">\n" +
                                "</a>" +
                                "                            </div>\n" +
                                "                            <div class=\"messagexx_right\">\n" +
                                "                                <div class=\"topx\">\n" +
                                "                                    <ul><li><a href=\"#\" id=\"sName\">"+item.shop_name+"</a></li></ul>\n" +
                                "                                    <p class=\"pf\">评分:"+item.shop_score+"</p>\n" +
                                "                                    <span class=\"_1p0FLy4t\">店铺电话:"+item.shop_telnumber+"</span>\n" +
                                "                                    <div style=\"width: 100%;height: 1px;background-color: #e0e0e0; margin: auto; margin-top: 5px;\"></div>\n" +
                                "                                </div>\n" +
                                "                                <div class=\"downx\">\n" +
                                "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\">营业时间"+item.business_time+"</p>\n" +
                                "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\"> 人均消费"+item.consumption+"</p>\n" +
                                "                                </div>\n" +
                                "                            </div>\n" +
                                "                        </div>"  +
                                "                                        </div>";
                            page="<div class=\"container\" style=\"text-align: center\">" +
                                "<ul class=\"pagination\">";
                            if (res.data.pageNum >= 2){
                                page += "<li><a href=\"javascript:void(0);\" onclick=\"js_method5("+(res.data.pageNum-1)+")\">&laquo;</a></li>";
                            }else {
                                page += " <li class=\"disabled\"><a>&laquo;</a></li>";
                            }
                            for (let i = res.data.pageNum; i <= (res.data.pages<6?res.data.pages:(res.data.pageNum+5)); i++) {
                                if (i==res.data.pageNum){
                                    page += "<li class=\"active\" style='background-color: #1ab394;'><a>"+i+"</a></li>";
                                }else {
                                    page += "<li><a href=\"javascript:void(0);\" onclick=\"js_method5("+i+")\">"+i+"</a></li>"
                                }
                            }
                            if (res.data.pageNum < res.data.pages){
                                page += "<li><a href=\"javascript:void(0);\" onclick=\"js_method5("+(res.data.pageNum+1)+")\">&raquo;</a></li>";
                            }
                            page+="     <li><a>当前页"+res.data.pageNum+"/"+res.data.pages+"总页数</a></li>" +
                                "   </ul>" +
                                "</div>";
                            Page = page;
                        })
                    $(".popular").html(str+Page);
                }
            })
        });
        function js_method5(page){
            $.ajax({
                type:"post",
                url:'${path}/fr/score/'+page+'',
                success:function(res) {
                    console.log(res.data)
                    console.log(res.data.list);
                    let list = eval(res.data.list)
                    let str =""
                    let page = "";
                    let Page = "";
                    $.each(list,function (idx,item) {
                        str+="<div class=\"pp\" id=\"likeee\">\n" +
                            "  <div class=\" first_restaurant\" style=\"height: 220px;background-color: white;margin-left: 70px\" id=\"idx\" >" +
                            "                            <div class=\"first_restaurant_left\">\n" +
                            "<a href='/fr/storeInfo/enter/"+item.id+"' onclick='writerHistory("+userIdHid+","+item.id+")'>" +
                            "                                <img  src=\"/fr"+item.shop_picture+"\" style=\" width: 272px; height: 212px;\"alt=\"\">\n" +
                            "</a>" +
                            "                            </div>\n" +
                            "                            <div class=\"messagexx_right\">\n" +
                            "                                <div class=\"topx\">\n" +
                            "                                    <ul><li><a href=\"#\" id=\"sName\">"+item.shop_name+"</a></li></ul>\n" +
                            "                                    <p class=\"pf\">评分:"+item.shop_score+"</p>\n" +
                            "                                    <span class=\"_1p0FLy4t\">店铺电话:"+item.shop_telnumber+"</span>\n" +
                            "                                    <div style=\"width: 100%;height: 1px;background-color: #e0e0e0; margin: auto; margin-top: 5px;\"></div>\n" +
                            "                                </div>\n" +
                            "                                <div class=\"downx\">\n" +
                            "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\">营业时间"+item.business_time+"</p>\n" +
                            "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\"> 人均消费"+item.consumption+"</p>\n" +
                            "                                </div>\n" +
                            "                            </div>\n" +
                            "                        </div>"  +
                            "                                        </div>";
                        page="<div class=\"container\" style=\"text-align: center\">" +
                            "<ul class=\"pagination\">";
                        if (res.data.pageNum >= 2){
                            page += "<li><a href=\"javascript:void(0);\" onclick=\"js_method5("+(res.data.pageNum-1)+")\">&laquo;</a></li>";
                        }else {
                            page += " <li class=\"disabled\"><a>&laquo;</a></li>";
                        }
                        for (let i = res.data.pageNum; i <= (res.data.pages<6?res.data.pages:(res.data.pageNum+5)); i++) {
                            if (i==res.data.pageNum){
                                page += "<li class=\"active\" style='background-color: #1ab394;'><a>"+i+"</a></li>";
                            }else {
                                page += "<li><a href=\"javascript:void(0);\" onclick=\"js_method5("+i+")\">"+i+"</a></li>"
                            }
                        }
                        if (res.data.pageNum < res.data.pages){
                            page += "<li><a href=\"javascript:void(0);\" onclick=\"js_method5("+(res.data.pageNum+1)+")\">&raquo;</a></li>";
                        }

                        page+="     <li><a>当前页"+res.data.pageNum+"/"+res.data.pages+"总页数</a></li>" +
                            "   </ul>" +
                            "</div>";
                        Page = page;
                    })
                    $(".popular").html(str+Page);
                }
            })
        };
</script>
<script>
    $(function () {
        $('.type1').click(function () {
            let str1=$(this).next().val();
            $.ajax({
                type:'post',
                url:'${path}/fr/type1/'+str1+'/1',
                success:function(res) {
                    console.log(res.data.list);
                    let list = eval(res.data.list)
                    let str =""
                    let page = "";
                    let Page = "";
                    $.each(list,function (idx,item) {
                        console.log(idx);
                        str+="<div class=\"pp\" id=\"likeee\">\n" +
                            "  <div class=\" first_restaurant\" style=\"height: 220px;background-color: white;margin-left: 70px\" id=\"idx\" >" +
                            "                            <div class=\"first_restaurant_left\">\n" +
                            "<a href='/fr/storeInfo/enter/"+item.id+"' onclick='writerHistory("+userIdHid+","+item.id+")'>" +
                            "                                <img  src=\"/fr"+item.shop_picture+"\" style=\" width: 272px; height: 212px;\"alt=\"\">\n" +
                            "</a>" +
                            "                            </div>\n" +
                            "                            <div class=\"messagexx_right\">\n" +
                            "                                <div class=\"topx\">\n" +
                            "                                    <ul><li><a href=\"#\" id=\"sName\">"+item.shop_name+"</a></li></ul>\n" +
                            "                                    <p class=\"pf\">评分:"+item.shop_score+"</p>\n" +
                            "                                    <span class=\"_1p0FLy4t\">店铺电话:"+item.shop_telnumber+"</span>\n" +
                            "                                    <div style=\"width: 100%;height: 1px;background-color: #e0e0e0; margin: auto; margin-top: 5px;\"></div>\n" +
                            "                                </div>\n" +
                            "                                <div class=\"downx\">\n" +
                            "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\">营业时间"+item.business_time+"</p>\n" +
                            "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\"> 人均消费"+item.consumption+"</p>\n" +
                            "                                </div>\n" +
                            "                            </div>\n" +
                            "                        </div>"  +
                            "                                        </div>";
                        page="<div class=\"container\" style=\"text-align: center\">" +
                            "<ul class=\"pagination\">";
                        if (res.data.pageNum >= 2){
                            page += "<li><a href=\"javascript:void(0);\" onclick=\"js_method("+(res.data.pageNum-1)+","+str1+")\">&laquo;</a></li>";
                        }else {
                            page += " <li class=\"disabled\"><a>&laquo;</a></li>";
                        }
                        for (let i = res.data.pageNum; i <= (res.data.pages<6?res.data.pages:(res.data.pageNum+5)); i++) {
                            if (i==res.data.pageNum){
                                page += "<li class=\"active\" style='background-color: #1ab394;'><a>"+i+"</a></li>";
                            }else {
                                page += "<li><a href=\"javascript:void(0);\" onclick=\"js_method("+i+","+str1+")\">"+i+"</a></li>"
                            }
                        }
                        if (res.data.pageNum < res.data.pages){
                            page += "<li><a href=\"javascript:void(0);\" onclick=\"js_method("+(res.data.pageNum+1)+","+str1+")\">&raquo;</a></li>";
                        }

                        page+="     <li><a>当前页"+res.data.pageNum+"/"+res.data.pages+"总页数</a></li>" +
                            "   </ul>" +
                            "</div>";
                        Page = page;
                    })
                    $(".pop").html(str+Page);
                }
            })

        })

    });
    function js_method(page,str1){
            $.ajax({
                type:'post',
                url:'/fr/fr/type1/'+str1+'/'+page+'',
                success:function(res) {
                    console.log(res.data.list);
                    let list = eval(res.data.list)
                    let str =""
                    let page = "";
                    let Page = "";
                    $.each(list,function (idx,item) {
                        str+="<div class=\"pp\" id=\"likeee\">\n" +
                            "  <div class=\" first_restaurant\" style=\"height: 220px;background-color: white;margin-left: 70px\" id=\"idx\" >" +
                            "                            <div class=\"first_restaurant_left\">\n" +
                            "<a href='/fr/storeInfo/enter/"+item.id+"' onclick='writerHistory("+userIdHid+","+item.id+")'>" +
                            "                                <img  src=\"/fr"+item.shop_picture+"\" style=\" width: 272px; height: 212px;\"alt=\"\">\n" +
                            "</a>" +
                            "                            </div>\n" +
                            "                            <div class=\"messagexx_right\">\n" +
                            "                                <div class=\"topx\">\n" +
                            "                                    <ul><li><a href=\"#\" id=\"sName\">"+item.shop_name+"</a></li></ul>\n" +
                            "                                    <p class=\"pf\">评分:"+item.shop_score+"</p>\n" +
                            "                                    <span class=\"_1p0FLy4t\">店铺电话:"+item.shop_telnumber+"</span>\n" +
                            "                                    <div style=\"width: 100%;height: 1px;background-color: #e0e0e0; margin: auto; margin-top: 5px;\"></div>\n" +
                            "                                </div>\n" +
                            "                                <div class=\"downx\">\n" +
                            "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\">营业时间"+item.business_time+"</p>\n" +
                            "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\"> 人均消费"+item.consumption+"</p>\n" +
                            "                                </div>\n" +
                            "                            </div>\n" +
                            "                        </div>"  +
                            "                                        </div>";
                        page="<div class=\"container\" style=\"text-align: center\">" +
                            "<ul class=\"pagination\">";
                        if (res.data.pageNum >= 2){
                            page += "<li><a href=\"javascript:void(0);\" onclick=\"js_method("+(res.data.pageNum-1)+","+str1+")\">&laquo;</a></li>";
                        }else {
                            page += " <li class=\"disabled\"><a>&laquo;</a></li>";
                        }
                        for (let i = res.data.pageNum; i <= (res.data.pages<6?res.data.pages:(res.data.pageNum+5)); i++) {
                            if (i==res.data.pageNum){
                                page += "<li class=\"active\" style='background-color: #1ab394;'><a>"+i+"</a></li>";
                            }else {
                                page += "<li><a href=\"javascript:void(0);\" onclick=\"js_method("+i+","+str1+")\">"+i+"</a></li>"
                            }
                        }
                        if (res.data.pageNum < res.data.pages){
                            page += "<li><a href=\"javascript:void(0);\" onclick=\"js_method("+(res.data.pageNum+1)+","+str1+")\">&raquo;</a></li>";
                        }

                        page+="     <li><a>当前页"+res.data.pageNum+"/"+res.data.pages+"总页数</a></li>" +
                            "   </ul>" +
                            "</div>";
                        Page = page;
                    })
                    $(".pop").html(str+Page);

                }

            })

    };
</script>
<script>
    $(function entersearch() {
        document.onkeydown=function(event){
            event=event || window.event;
            if (event.keyCode == "13") {
                let str9 = document.getElementById("search1").value;
                $.ajax({
                    type:'post',
                    url:'${path}/fr/select/'+str9+'/1',
                    success:function(res) {
                        console.log(res.data.list);
                        let list = eval(res.data.list)
                        let str =""
                        let page = "";
                        let Page = "";
                        $.each(list,function (idx,item) {
                            console.log(idx);
                            str+="<div class=\"pp\" id=\"likeee\">\n" +
                                "  <div class=\" first_restaurant\" style=\"height: 220px;background-color: white;margin-left: 70px\" id=\"idx\" >" +
                                "                            <div class=\"first_restaurant_left\">\n" +
                                "<a href='/fr/storeInfo/enter/"+item.id+"' onclick='writerHistory("+userIdHid+","+item.id+")'>" +
                                "                                <img  src=\"/fr"+item.shop_picture+"\" style=\" width: 272px; height: 212px;\"alt=\"\">\n" +
                                "</a>" +
                                "                            </div>\n" +
                                "                            <div class=\"messagexx_right\">\n" +
                                "                                <div class=\"topx\">\n" +
                                "                                    <ul><li><a href=\"#\" id=\"sName\">"+item.shop_name+"</a></li></ul>\n" +
                                "                                    <p class=\"pf\">评分:"+item.shop_score+"</p>\n" +
                                "                                    <span class=\"_1p0FLy4t\">店铺电话:"+item.shop_telnumber+"</span>\n" +
                                "                                    <div style=\"width: 100%;height: 1px;background-color: #e0e0e0; margin: auto; margin-top: 5px;\"></div>\n" +
                                "                                </div>\n" +
                                "                                <div class=\"downx\">\n" +
                                "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\">营业时间"+item.business_time+"</p>\n" +
                                "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\"> 人均消费"+item.consumption+"</p>\n" +
                                "                                </div>\n" +
                                "                            </div>\n" +
                                "                        </div>"  +
                                "                                        </div>";
                            page="<div class=\"container\" style=\"text-align: center\">" +
                                "<ul class=\"pagination\">";
                            if (res.data.pageNum >= 2){
                                page += "<li><a href=\"javascript:void(0);\" onclick=\'js_method3("+(res.data.pageNum-1)+",\""+str9+"\")\'>&laquo;</a></li>";
                            }else {
                                page += " <li class=\"disabled\"><a>&laquo;</a></li>";
                            }
                            for (let i = res.data.pageNum; i <= (res.data.pages<6?res.data.pages:(res.data.pageNum+5)); i++) {
                                if (i==res.data.pageNum){
                                    page += "<li class=\"active\" style='background-color: #1ab394;'><a>"+i+"</a></li>";
                                }else {
                                    page += "<li><a href=\"javascript:void(0);\" onclick=\'js_method3("+i+",\""+str9+"\")\'>"+i+"</a></li>"
                                }
                            }
                            if (res.data.pageNum < res.data.pages){
                                page += "<li><a href=\"javascript:void(0);\" onclick=\'js_method3("+(res.data.pageNum+1)+",\""+str9+"\")\'>&raquo;</a></li>";
                            }

                            page+="     <li><a>当前页"+res.data.pageNum+"/"+res.data.pages+"总页数</a></li>" +
                                "   </ul>" +
                                "</div>";
                            Page = page;
                        })
                        $(".pop").html(str+Page);
                    }
                })

            }}

    });
    function js_method3(page,str9){
        $.ajax({
            type:'post',
            url:'/fr/fr/select/'+str9+'/'+page+'',
            success:function(res) {
                console.log(res.data.list);
                let list = eval(res.data.list)
                let str =""
                let page = "";
                let Page = "";
                $.each(list,function (idx,item) {
                    str+="<div class=\"pp\" id=\"likeee\">\n" +
                        "  <div class=\" first_restaurant\" style=\"height: 220px;background-color: white;margin-left: 70px\" id=\"idx\" >" +
                        "                            <div class=\"first_restaurant_left\">\n" +
                        "<a href='/fr/storeInfo/enter/"+item.id+"' onclick='writerHistory("+userIdHid+","+item.id+")'>" +
                        "                                <img  src=\"/fr"+item.shop_picture+"\" style=\" width: 272px; height: 212px;\"alt=\"\">\n" +
                        "</a>" +
                        "                            </div>\n" +
                        "                            <div class=\"messagexx_right\">\n" +
                        "                                <div class=\"topx\">\n" +
                        "                                    <ul><li><a href=\"#\" id=\"sName\">"+item.shop_name+"</a></li></ul>\n" +
                        "                                    <p class=\"pf\">评分:"+item.shop_score+"</p>\n" +
                        "                                    <span class=\"_1p0FLy4t\">店铺电话:"+item.shop_telnumber+"</span>\n" +
                        "                                    <div style=\"width: 100%;height: 1px;background-color: #e0e0e0; margin: auto; margin-top: 5px;\"></div>\n" +
                        "                                </div>\n" +
                        "                                <div class=\"downx\">\n" +
                        "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\">营业时间"+item.business_time+"</p>\n" +
                        "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\"> 人均消费"+item.consumption+"</p>\n" +
                        "                                </div>\n" +
                        "                            </div>\n" +
                        "                        </div>"  +
                        "                                        </div>";
                    page="<div class=\"container\" style=\"text-align: center\">" +
                        "<ul class=\"pagination\">";
                    if (res.data.pageNum >= 2){
                        page += "<li><a href=\"javascript:void(0);\" onclick=\'js_method3("+(res.data.pageNum-1)+",\""+str9+"\")\'>&laquo;</a></li>";
                    }else {
                        page += " <li class=\"disabled\"><a>&laquo;</a></li>";
                    }
                    for (let i = res.data.pageNum; i <= (res.data.pages<6?res.data.pages:(res.data.pageNum+5)); i++) {
                        if (i==res.data.pageNum){
                            page += "<li class=\"active\" style='background-color: #1ab394;'><a>"+i+"</a></li>";
                        }else {
                            page += "<li><a href=\"javascript:void(0);\" onclick=\'js_method3("+i+",\""+str9+"\")\'>"+i+"</a></li>"
                        }
                    }
                    if (res.data.pageNum < res.data.pages){
                        page += "<li><a href=\"javascript:void(0);\" onclick=\'js_method3("+(res.data.pageNum+1)+",\""+str9+"\")\'>&raquo;</a></li>";
                    }

                    page+="     <li><a>当前页"+res.data.pageNum+"/"+res.data.pages+"总页数</a></li>" +
                        "   </ul>" +
                        "</div>";
                    Page = page;
                })
                $(".pop").html(str+Page);

            }

        })

    };
</script>
<script>
    $(function () {
        $('.pl').click(function () {
            let str3=$(this).next().val();
            $.ajax({
                type:'post',
                url:'${path}/fr/area/'+str3+'/1',
                success:function(res) {
                    console.log(res.data.list);
                    let list = eval(res.data.list)
                    let str =""
                    let page = "";
                    let Page = "";
                    $.each(list,function (idx,item) {
                        console.log(idx);
                        str+="<div class=\"pp\" id=\"likeee\">\n" +
                            "  <div class=\" first_restaurant\" style=\"height: 220px;background-color: white;margin-left: 70px\" id=\"idx\" >" +
                            "                            <div class=\"first_restaurant_left\">\n" +
                            "<a href='/fr/storeInfo/enter/"+item.id+"' onclick='writerHistory("+userIdHid+","+item.id+")'>" +
                            "                                <img  src=\"/fr"+item.shop_picture+"\" style=\" width: 272px; height: 212px;\"alt=\"\">\n" +
                            "</a>" +
                            "                            </div>\n" +
                            "                            <div class=\"messagexx_right\">\n" +
                            "                                <div class=\"topx\">\n" +
                            "                                    <ul><li><a href=\"#\" id=\"sName\">"+item.shop_name+"</a></li></ul>\n" +
                            "                                    <p class=\"pf\">评分:"+item.shop_score+"</p>\n" +
                            "                                    <span class=\"_1p0FLy4t\">店铺电话:"+item.shop_telnumber+"</span>\n" +
                            "                                    <div style=\"width: 100%;height: 1px;background-color: #e0e0e0; margin: auto; margin-top: 5px;\"></div>\n" +
                            "                                </div>\n" +
                            "                                <div class=\"downx\">\n" +
                            "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\">营业时间"+item.business_time+"</p>\n" +
                            "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\"> 人均消费"+item.consumption+"</p>\n" +
                            "                                </div>\n" +
                            "                            </div>\n" +
                            "                        </div>"  +
                            "                                        </div>";
                        page="<div class=\"container\" style=\"text-align: center\">" +
                            "<ul class=\"pagination\">";
                        if (res.data.pageNum >= 2){
                            page += "<li><a href=\"javascript:void(0);\" onclick=\'js_method2("+(res.data.pageNum-1)+",\""+str3+"\")\'>&laquo;</a></li>";
                        }else {
                            page += " <li class=\"disabled\"><a>&laquo;</a></li>";
                        }
                        for (let i = res.data.pageNum; i <= (res.data.pages<6?res.data.pages:(res.data.pageNum+5)); i++) {
                            if (i==res.data.pageNum){
                                page += "<li class=\"active\" style='background-color: #1ab394;'><a>"+i+"</a></li>";
                            }else {
                                page += "<li><a href=\"javascript:void(0);\" onclick=\'js_method2("+i+",\""+str3+"\")\'>"+i+"</a></li>"
                            }
                        }
                        if (res.data.pageNum < res.data.pages){
                            page += "<li><a href=\"javascript:void(0);\" onclick=\'js_method2("+(res.data.pageNum+1)+",\""+str3+"\")\'>&raquo;</a></li>";
                        }

                        page+="     <li><a>当前页"+res.data.pageNum+"/"+res.data.pages+"总页数</a></li>" +
                            "   </ul>" +
                            "</div>";
                        Page = page;
                    })
                    $(".pop").html(str+Page);
                }
            })

        })

    });
    function js_method2(page,str3){
        $.ajax({
            type:'post',
            url:'/fr/fr/area/'+str3+'/'+page+'',
            success:function(res) {
                console.log(res.data.list);
                let list = eval(res.data.list)
                let str =""
                let page = "";
                let Page = "";
                $.each(list,function (idx,item) {
                    str+= "<div class=\"pp\" id=\"likeee\">\n" +
                        "  <div class=\" first_restaurant\" style=\"height: 220px;background-color: white;margin-left: 70px\" id=\"idx\" >" +
                        "                            <div class=\"first_restaurant_left\">\n" +
                        "<a href='/fr/storeInfo/enter/"+item.id+"' onclick='writerHistory("+userIdHid+","+item.id+")'>" +
                        "                                <img  src=\"/fr"+item.shop_picture+"\" style=\" width: 272px; height: 212px;\"alt=\"\">\n" +
                        "</a>" +
                        "                            </div>\n" +
                        "                            <div class=\"messagexx_right\">\n" +
                        "                                <div class=\"topx\">\n" +
                        "                                    <ul><li><a href=\"#\" id=\"sName\">"+item.shop_name+"</a></li></ul>\n" +
                        "                                    <p class=\"pf\">评分:"+item.shop_score+"</p>\n" +
                        "                                    <span class=\"_1p0FLy4t\">店铺电话:"+item.shop_telnumber+"</span>\n" +
                        "                                    <div style=\"width: 100%;height: 1px;background-color: #e0e0e0; margin: auto; margin-top: 5px;\"></div>\n" +
                        "                                </div>\n" +
                        "                                <div class=\"downx\">\n" +
                        "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\">营业时间"+item.business_time+"</p>\n" +
                        "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\"> 人均消费"+item.consumption+"</p>\n" +
                        "                                </div>\n" +
                        "                            </div>\n" +
                        "                        </div>"  +
                        "                                        </div>";
                    page="<div class=\"container\" style=\"text-align: center\">" +
                        "<ul class=\"pagination\">";
                    if (res.data.pageNum >= 2){
                        page += "<li><a href=\"javascript:void(0);\" onclick=\'js_method2("+(res.data.pageNum-1)+",\""+str3+"\")\'>&laquo;</a></li>";
                    }else {
                        page += " <li class=\"disabled\"><a>&laquo;</a></li>";
                    }
                    for (let i = res.data.pageNum; i <= (res.data.pages<6?res.data.pages:(res.data.pageNum+5)); i++) {
                        if (i==res.data.pageNum){
                            page += "<li class=\"active\" style='background-color: #1ab394;'><a>"+i+"</a></li>";
                        }else {
                            page += "<li><a href=\"javascript:void(0);\" onclick=\'js_method2("+i+",\""+str3+"\")\'>"+i+"</a></li>"
                        }
                    }
                    if (res.data.pageNum < res.data.pages){
                        page += "<li><a href=\"javascript:void(0);\" onclick=\'js_method2("+(res.data.pageNum+1)+",\""+str3+"\")\'>&raquo;</a></li>";
                    }

                    page+="     <li><a>当前页"+res.data.pageNum+"/"+res.data.pages+"总页数</a></li>" +
                        "   </ul>" +
                        "</div>";
                    Page = page;
                })
                $(".pop").html(str+Page);

            }

        })

    };

    // function enter_method(shopId) {
    //     $.get("/fr/storeInfo/enter/"+shopId+"");
    // }
</script>
<script>
    $(function () {
        $('.consumption').click(function () {
            let str2=$(this).next().val();
            let str4=$(this).next().next().val();
            $.ajax({
                type:'post',
                url:'${path}/fr/price/'+str2+'/'+str4+'/1',
                success:function(res) {
                    console.log(res.data.list);
                    let list = eval(res.data.list)
                    let str =""
                    let page = "";
                    let Page = "";
                    $.each(list,function (idx,item) {
                        console.log(idx);
                        str+="<div class=\"pp\" id=\"likeee\">\n" +
                            "  <div class=\" first_restaurant\" style=\"height: 220px;background-color: white;margin-left: 70px\" id=\"idx\" >" +
                            "                            <div class=\"first_restaurant_left\">\n" +
                            "<a href='/fr/storeInfo/enter/"+item.id+"' onclick='writerHistory("+userIdHid+","+item.id+")'>" +
                            "                                <img  src=\"/fr"+item.shop_picture+"\" style=\" width: 272px; height: 212px;\"alt=\"\">\n" +
                            "</a>" +                            "                            </div>\n" +
                            "                            <div class=\"messagexx_right\">\n" +
                            "                                <div class=\"topx\">\n" +
                            "                                    <ul><li><a href=\"#\" id=\"sName\">"+item.shop_name+"</a></li></ul>\n" +
                            "                                    <p class=\"pf\">评分:"+item.shop_score+"</p>\n" +
                            "                                    <span class=\"_1p0FLy4t\">店铺电话:"+item.shop_telnumber+"</span>\n" +
                            "                                    <div style=\"width: 100%;height: 1px;background-color: #e0e0e0; margin: auto; margin-top: 5px;\"></div>\n" +
                            "                                </div>\n" +
                            "                                <div class=\"downx\">\n" +
                            "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\">营业时间"+item.business_time+"</p>\n" +
                            "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\"> 人均消费"+item.consumption+"</p>\n" +
                            "                                </div>\n" +
                            "                            </div>\n" +
                            "                        </div>"  +
                            "                                        </div>";
                        page="<div class=\"container\" style=\"text-align: center\">" +
                            "<ul class=\"pagination\">";
                        if (res.data.pageNum >= 2){
                            page += "<li><a href=\"javascript:void(0);\" onclick=\"js_method1("+(res.data.pageNum-1)+","+str2+","+str4+")\">&laquo;</a></li>";
                        }else {
                            page += " <li class=\"disabled\"><a>&laquo;</a></li>";
                        }
                        for (let i = res.data.pageNum; i <= (res.data.pages<6?res.data.pages:(res.data.pageNum+5)); i++) {
                            if (i==res.data.pageNum){
                                page += "<li class=\"active\" style='background-color: #1ab394;'><a>"+i+"</a></li>";
                            }else {
                                page += "<li><a href=\"javascript:void(0);\" onclick=\"js_method1("+i+","+str2+","+str4+")\">"+i+"</a></li>"
                            }
                        }
                        if (res.data.pageNum < res.data.pages){
                            page += "<li><a href=\"javascript:void(0);\" onclick=\"js_method1("+(res.data.pageNum+1)+","+str2+","+str4+")\">&raquo;</a></li>";
                        }

                        page+="     <li><a>当前页"+res.data.pageNum+"/"+res.data.pages+"总页数</a></li>" +
                            "   </ul>" +
                            "</div>";
                        Page = page;
                    })
                    $(".pop").html(str+Page);
                }
            })

        })

    });
    function js_method1(page,str2,str4){
        $.ajax({
            type:'post',
            url:'/fr/fr/price/'+str2+'/'+str4+'/'+page+'',
            success:function(res) {
                console.log(res.data.list);
                let list = eval(res.data.list)
                let str =""
                let page = "";
                let Page = "";
                $.each(list,function (idx,item) {
                    str+="<div class=\"pp\" id=\"likeee\">\n" +
                        "  <div class=\" first_restaurant\" style=\"height: 220px;background-color: white;margin-left: 70px\" id=\"idx\" >" +
                        "                            <div class=\"first_restaurant_left\">\n" +
                        "<a href='/fr/storeInfo/enter/"+item.id+"' onclick='writerHistory("+userIdHid+","+item.id+")'>" +
                        "                                <img  src=\"/fr"+item.shop_picture+"\" style=\" width: 272px; height: 212px;\"alt=\"\">\n" +
                        "</a>" +                        "                            </div>\n" +
                        "                            <div class=\"messagexx_right\">\n" +
                        "                                <div class=\"topx\">\n" +
                        "                                    <ul><li><a href=\"#\" id=\"sName\">"+item.shop_name+"</a></li></ul>\n" +
                        "                                    <p class=\"pf\">评分:"+item.shop_score+"</p>\n" +
                        "                                    <span class=\"_1p0FLy4t\">店铺电话:"+item.shop_telnumber+"</span>\n" +
                        "                                    <div style=\"width: 100%;height: 1px;background-color: #e0e0e0; margin: auto; margin-top: 5px;\"></div>\n" +
                        "                                </div>\n" +
                        "                                <div class=\"downx\">\n" +
                        "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\">营业时间"+item.business_time+"</p>\n" +
                        "                                    <p class=\"pj\"><img src=\"/fr/imgs/classify/评论1.png\" alt=\"\"> 人均消费"+item.consumption+"</p>\n" +
                        "                                </div>\n" +
                        "                            </div>\n" +
                        "                        </div>"  +
                        "                                        </div>";
                    page="<div class=\"container\" style=\"text-align: center\">" +
                        "<ul class=\"pagination\">";
                    if (res.data.pageNum >= 2){
                        page += "<li><a href=\"javascript:void(0);\" onclick=\"js_method1("+(res.data.pageNum-1)+","+str2+","+str4+")\">&laquo;</a></li>";
                    }else {
                        page += " <li class=\"disabled\"><a>&laquo;</a></li>";
                    }
                    for (let i = res.data.pageNum; i <= (res.data.pages<6?res.data.pages:(res.data.pageNum+5)); i++) {
                        if (i==res.data.pageNum){
                            page += "<li class=\"active\" style='background-color: #1ab394;'><a>"+i+"</a></li>";
                        }else {
                            page += "<li><a href=\"javascript:void(0);\" onclick=\"js_method1("+i+","+str2+","+str4+")\">"+i+"</a></li>"
                        }
                    }
                    if (res.data.pageNum < res.data.pages){
                        page += "<li><a href=\"javascript:void(0);\" onclick=\"js_method1("+(res.data.pageNum+1)+","+str2+","+str4+")\">&raquo;</a></li>";
                    }

                    page+="     <li><a>当前页"+res.data.pageNum+"/"+res.data.pages+"总页数</a></li>" +
                        "   </ul>" +
                        "</div>";
                    Page = page;
                })
                $(".pop").html(str+Page);

            }

        })

    };

    function writerHistory(userId,shopId) {
        $.ajax({
            type:"post",
            url:"/fr/personal/history/"+userId+"/"+shopId+""
        })
    }
</script>
<script>
    function doSeckill(userId,seckillId) {
        console.log(userId+":"+seckillId)
        $.ajax({
            type:"post",
            url:"/fr/fr/seckill/"+userId+"/"+seckillId+"",
            success:function (res) {
                alert(res);
            }
        })
    }

    let arr = [];
    $("input[name='timeSeckill']").each(function () {
        arr.push($(this).val());
    })
    let time = [];
    $("input[name^='time_']").each(function () {
        time.push($(this).val());
    })

    console.log(time);
    function daoTime(){
    for (let i = 0; i < arr.length; i++) {

            //获取当前系统时间
            let now = new Date();
            let endTime =new Date(time[i]);
            let sec = (endTime - now) / 1000;
            //剩余的秒数
            //25小时
            let d = parseInt(sec / 60 / 60 / 24);

            // 36小时=1天 + 12小时
            //hours%24
            let hours = parseInt((sec / 60 / 60) % 24);

            //76秒
            //2h10分钟 = 130m*60 = 7800
            //结论 -> min%60
            let m = parseInt((sec / 60) % 60);

            //seconds % 60
            let s = parseInt(sec % 60);

            let str = "剩余:" + d + "天" + hours + "时" + m + "分" + s + "秒";
            $("#"+arr[i]).html(str);
            let secId = arr[i].substring(5,arr[i].length);
            if (sec<=0){
                $.ajax({
                    type:"post",
                    url:"/fr/fr/cancelSeckill/"+secId+"",
                    success:function () {
                        location.reload();
                    }
                })
            }
        }
    }

    let s = setInterval(daoTime, 1000);
</script>
</body>
</html>
